const db = require('../db/index')//引入数据库

exports.getTyphoonList = (req, res) => {
  const sql = 'select * from typhoon_list where year = ?'
  db.query(sql, [req.body.year], (err, results) => {
    if (err) return res.ce(err)
    res.send({
      status: 0,
      message: '获取台风列表成功',
      data: results
    })
  })
}